package com.sip.stream.utils.zfy.player;

import android.content.Context;
import android.view.Surface;

public abstract class AbstractRemoteVideoPlayer {
    private Context context;
    private AbstractRemoteVideoPlayerListener listener;
    protected Surface surface;

    public interface AbstractRemoteVideoPlayerListener {
        void onVideoConfigure(int i, int i2);
        void setVideoHolder(boolean z);
        void showTip(String str);
    }

    public abstract void release();

    public abstract void startPlay();

    public AbstractRemoteVideoPlayer(Context context) {
        this.context = context;
    }

    public void setSurface(Surface surface) {
        this.surface = surface;
    }

    public Surface getSurface() {
        return this.surface;
    }

    public void setListener(AbstractRemoteVideoPlayerListener abstractRemoteVideoPlayerListener) {
        this.listener = abstractRemoteVideoPlayerListener;
    }

    protected Context getContext() {
        return this.context;
    }

    public void setVideoHolder(boolean z) {
        AbstractRemoteVideoPlayerListener abstractRemoteVideoPlayerListener = this.listener;
        if (abstractRemoteVideoPlayerListener != null) {
            abstractRemoteVideoPlayerListener.setVideoHolder(z);
        }
    }

    public void onVideoConfigure(int i, int i2) {
        AbstractRemoteVideoPlayerListener abstractRemoteVideoPlayerListener = this.listener;
        if (abstractRemoteVideoPlayerListener != null) {
            abstractRemoteVideoPlayerListener.onVideoConfigure(i, i2);
        }
    }

    public void setTip(String str) {
        AbstractRemoteVideoPlayerListener abstractRemoteVideoPlayerListener = this.listener;
        if (abstractRemoteVideoPlayerListener != null) {
            abstractRemoteVideoPlayerListener.showTip(str);
        }
    }
}
